package router

import (
	"go_final/mxshop_api/goods_web/api/category"
	middlewares "go_final/mxshop_api/goods_web/middleware"

	"github.com/gin-gonic/gin"
)

func InitCategoryRouter(Router *gin.RouterGroup) {
	GoodsRouter := Router.Group("category")

	{
		GoodsRouter.GET("", category.List)
		GoodsRouter.POST("", middlewares.JWTAuth(), middlewares.IsAdmin(), category.Create)
		GoodsRouter.GET("/:id", category.Detail)
		GoodsRouter.DELETE("/:id", middlewares.JWTAuth(), middlewares.IsAdmin(), category.Delete)
		GoodsRouter.PUT("/:id", middlewares.JWTAuth(), middlewares.IsAdmin(), category.Update)
	}
}
